package com.itCar.base.api.wxApi.wxAuth.pojo.info;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: NewsMessage
 * @Description: TODO
 * @author: liuzg
 * @Date: 2022/8/31 17:20
 * @Week: 星期三
 * @Version: v1.0
 */
@Data
@XStreamAlias("xml")
public class NewsMessage extends BaseMessage {

    @XStreamAlias("ArticleCount")
    private String articleCount;
    @XStreamAlias("Articles")
    private List<Article> articles = new ArrayList<>();

    public NewsMessage(Map<String, String> requestMap, List<Article> articles) {
        super(requestMap);
        setMsgType("news");
        this.articleCount = articles.size()+"";
        this.articles = articles;
    }
}

//@Data
//class Article {
//
//    @XStreamAlias("Title")
//    private String title;
//    @XStreamAlias("Description")
//    private String description;
//    @XStreamAlias("PicUrl")
//    private String picUrl;
//    @XStreamAlias("Url")
//    private String url;
//
//    public Article(){}
//
//    public Article(String title, String description, String picUrl, String url) {
//        this.title = title;
//        this.description = description;
//        this.picUrl = picUrl;
//        this.url = url;
//    }
//}